﻿@model PagedList.IPagedList<KLY.DataModels.SearchLine>
@using PagedList.Mvc;
<div class="wrap">
    <div class="selector">
        <input type="hidden" id="pageName" value="vipline" />
        <form action="/Freight/vipline" method="get" role="form">
            <dl>
                <dt>
                    <span>
                        <em>始发地</em>
                        <select id="Start_Area" name="Start_Area" rel="@ViewBag.Start_Area">
                            <option>安徽</option>
                        </select>
                    </span>
                    <span>
                        <em>始发地</em>
                        <select id="End_Area" name="End_Area" rel="@ViewBag.End_Area">
                            <option>安徽</option>
                        </select>
                    </span>
                    <span>
                        <input type="submit" class="btn-query" value="查询" />
                    </span>
                </dt>
            </dl>
        </form>

    </div>
    <div class="zclist">
        <dl>
            <dt>
                <span class="w308">物流公司/个人</span>
                <span class="wleft">运输线路</span>
                <span>运输时效</span>
                <span>运输价格</span>
                <span>操作</span>
            </dt>
@foreach (var item in Model)
{
            <dd>
                <span class="w308">
                    <i>@Html.DisplayFor(modelItem => item.owner_name)</i>
                    <em>@Html.DisplayFor(modelItem => item.Corp_Name)</em>
                </span>
                <span class="wleft">从：<small>@Html.DisplayFor(modelItem => item.Start_Area)</small><br />到：<small>@Html.DisplayFor(modelItem => item.End_Area)</small></span>
                <span><small>@Html.DisplayFor(modelItem => item.term_of_validity)天</small><br /></span>
                <span class="wleft">
                    重货：<samp>@Html.DisplayFor(modelItem => item.heavy_cargo_price)</samp>元/公斤<br />
                    泡货：<samp>@Html.DisplayFor(modelItem => item.Light_Cargo_Price)</samp>元/立方<br />
                    最低一票：@Html.DisplayFor(modelItem => item.Base_Price);元
                </span>
                <span><a href="#" class="btn">我要发货</a></span>
            </dd>
}
        </dl>
    </div>
    <div style="text-align:right">
        @Html.PagedListPager(Model, page => Url.Action("vipline", new { ViewBag.Start_Area, ViewBag.End_Area, page }))
    </div>
</div>
<script language="javascript">
    $(document).ready(function () {
        $.ajax({
            url: "/api/DistinctApi/GetAllProvinceInfo",
            type: "GET",
            success: function (data) {
                //alert(JSON.stringify(data.result));
                var departCity = $("#Start_Area");
                var arriveCity = $("#End_Area");

                $("#Start_Area option").remove();
                $("#End_Area option").remove();

                departCity.append("<option value='-1'>选择起始地</option>");
                arriveCity.append("<option value='-1'>选择目的地</option>");

                $.each(JSON.parse(data).result, function (key, value) {
                    var opt = $("<option></option>").text(value).val(key);
                    var opt2 = $("<option></option>").text(value).val(key);
                    departCity.append(opt);
                    arriveCity.append(opt2);
                });
                $("#Start_Area").val($("#Start_Area").attr("rel"));
                $("#End_Area").val($("#End_Area").attr("rel"));
            }
        });
    });
</script>